package com.itheima.api.treeset.demo02;

import java.util.TreeSet;

public class StudentDemo02 {

    public static void main(String[] args) {

        Student s1 = new Student("晓星尘", 23);
        Student s2 = new Student("宋子琛", 24);
        Student s3 = new Student("霜华", 17);
        Student s4 = new Student("拂雪", 17);

        TreeSet<Student> treeSet = new TreeSet<Student>();

        treeSet.add(s1);
        treeSet.add(s2);
        treeSet.add(s3);
        treeSet.add(s4);

        for (Student s : treeSet){
            System.out.println(s);
        }

    }
}
